const express = require('express')

const router = express.Router()

const userinfo_handler = require('../router_handler/userinfo')

const expressJoi = require('@escook/express-joi')

const { updateRuls,updatePwd,updateAvatar } = require('../ValidationRules/user')

router.get('/userinfo',userinfo_handler.userinfo)

router.get('/user',userinfo_handler.user)

router.post('/updateUser',expressJoi(updateRuls),userinfo_handler.updateUser)

router.post('/updatePwd',expressJoi(updatePwd),userinfo_handler.updatePwd)

router.post('/updateAvater',expressJoi(updateAvatar),userinfo_handler.updateAvater)

module.exports = router